package com.gitee.elasticjob.controller;

import com.gitee.elasticjob.handler.ElasticJobHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("job")
public class ElasticJobController {
    @Resource
    private ElasticJobHandler elasticJobHandler;

    @PostMapping("add")
    public boolean add() {
        return this.elasticJobHandler.addJob("testJob", "0 0/1 * * * ? ", 2, "66666", "0=A,1=B");
    }
}
